{% extends 'base.html' %}
{% load staticfiles %}
{% load r_extra %}
{% block extra_head %}
    <link rel="stylesheet" href="{% static 'post/css/review_square.css' %}">
{% endblock %}
{% block navbar %}
    <div class="search-box">
        <div class="s-review-movie">
            <div class="input-group input-group-lg">
                <input type="text" oninput="" class="form-control s-movie-search" placeholder="关键字" required
                       aria-describedby="sizing-addon1" list="movie-list">
                <span role="button" class="input-group-addon movie-search-action" id="sizing-addon1">搜索</span>
            </div>
        </div>
    </div>
{% endblock %}

{% block content %}
    <br>
    <br>
    <div id="review-square">
        <div class="content-bd">
            <section>
                <ul class="review-list">
                    {% for review in reviews %}
                        <li>
                            <p class="review-user-avatar">
                                <a href="javascript:void(0)">
                                    {% if review.user.avatar %}
                                        <img src="{{ review.user.avatar.url }}" alt=""/>
                                    {% else %}
                                        <img src="" alt="">
                                    {% endif %}
                                </a>
                            </p>
                            <p class="review-user-name">
                                {{ review.user.username }}
                            </p>
                            <p class="review-movie-name">
                        <span>
                            <strong>电影:</strong>
                            {{ review.movie.title }}
                        </span>
                            </p>
                            <p class="review-title">
                            <span>
                            <strong>图解</strong>
                                {{ review.title }}
                        </span>
                            </p>
                            <p class="review-meta"><span>
                            <strong>{{ review|get_r_comments }}</strong>人评论
                            <span>|</span>
                            <strong>{{ review.score }}</strong>赞
                        </span></p>
                            <p>
                                <a href="{% url 'post:review_detail' review.id %}" type="button">进入</a>
                            </p>
                        </li>
                    {% endfor %}
                </ul>
            </section>
        </div>

    <div id="load-more">
        <input type="hidden" id="pageNo" value="{{ info.pageNo }}" data-key="">
        <div class="load-more" data-status="{{ info.state }}">
            <a href="javascript:void(0)" id="load-more-action">
                <span class="btn default primary load-more-text">加载更多</span>
            </a>
        </div>
    </div>
    </div>
{% endblock %}
{% block script %}
    <script src="{% static 'post/js/review_square.js' %}"></script>

{% endblock %}